package com.yt.order.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.order.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.order.mapper.EmpRetreatMapper;
import com.yt.order.models.service.IEmpRetreatService;
import com.yt.order.models.bo.EmpRetreatSaveBO;
import com.yt.order.models.dto.EmpRetreatDTO;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 员工退单表控制器
 *
 * @author zhou
 * @Date 2025-09-15 10:59:40
 */
@DubboService
public class EmpRetreatServiceImpl extends ServiceImpl<EmpRetreatMapper, EmpRetreatDTO> implements IEmpRetreatService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(EmpRetreatSaveBO saveBO) {
        EmpRetreatDTO dto = new EmpRetreatDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }

    @Override
    public List<Long> queryRetreat(Long employeeId) {
        List<Long> retreatIds =baseMapper.queryRetreatId(employeeId);
        return retreatIds;
    }

    @Override
    public List<Long> queryRet(Long id) {
        List<Long> retreatIds =baseMapper.queryRetId(id);
        return retreatIds;
    }
}
